package sqlToGUI.testing.sendingInput;

import java.util.LinkedList;

public class BatteryDataCreator extends DataCreator{

	private LinkedList <Character>buff;

	private int minVoltage = 1000;
	private int maxVoltage = 1000;
	private int currentIn = 1000;
	private int currentOut = 1000;
	
	private String minVoltageS;
	private String maxVoltageS;
	private String currentInS;
	private String currentOutS;
	
	public BatteryDataCreator(LinkedList <Character>buff){
		this.buff = buff;
	}
	
	public void update(){

		minVoltageS = fixDataLength(minVoltage + "", inputLength);
		maxVoltageS = fixDataLength(maxVoltage + "", inputLength);
		currentInS = fixDataLength(currentIn + "", inputLength);
		currentOutS = fixDataLength(currentOut + "", inputLength);
		
		buff.add('$'); buff.add('#');
		buff.add('9'); buff.add('1');
		buff.add(minVoltageS.charAt(0));
		buff.add(minVoltageS.charAt(1));
		buff.add(minVoltageS.charAt(2));
		buff.add(minVoltageS.charAt(3));
		
		buff.add('$'); buff.add('#');
		buff.add('9'); buff.add('2');
		buff.add(maxVoltageS.charAt(0));
		buff.add(maxVoltageS.charAt(1));
		buff.add(maxVoltageS.charAt(2));
		buff.add(maxVoltageS.charAt(3));
		
		buff.add('$'); buff.add('#');
		buff.add('9'); buff.add('3');
		buff.add(currentInS.charAt(0));
		buff.add(currentInS.charAt(1));
		buff.add(currentInS.charAt(2));
		buff.add(currentInS.charAt(3));
		
		buff.add('$'); buff.add('#');
		buff.add('9'); buff.add('4');
		buff.add(currentOutS.charAt(0));
		buff.add(currentOutS.charAt(1));
		buff.add(currentOutS.charAt(2));
		buff.add(currentOutS.charAt(3));
	}
}